home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / msdemo.zip / MSDEMO.DOC < prev    next >
Text File  |  1993-01-04  |  3KB  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                              INTERRUPT DRIVEN MOUSE DEMO
  8.       
  9.              The   files  contained  in  MSDEMO.ARC   are  a  simple  text  mode
  10.      demonstration  of using interrupt driven mouse  control from within a Turbo
  11.      Pascal  program.  This  method,  while more  complex  to  implement  from a
  12.      programming  standpoint, is simpler to use once implemented. It is also the
  13.      prefered method, because it frees the program from having to poll the mouse
  14.      driver for the current status of the mouse.
  15.           The  code for this program  was inspired by an  article written by Ray
  16.      Duncan  for the Power Programming  column in PC Magazine.  For those of you
  17.      who  are interested, the article appeared in the May 16, 1989, Vol 8, No. 9
  18.      issue.
  19.           The  demo program was compiled using  Turbo Pascal 5.5 but should also
  20.      compile  under 4.0  or 5.0. The  assembler portion was  written using IDEAL
  21.      mode syntax and assembled using TASM.
  22.       
  23.         MSDEMO.ARC files:
  24.           MOUSE.PAS      :Source code for the MOUSE unit.
  25.           MOUSE.TPU      :MOUSE unit compiled with TP 5.5
  26.           MOUSE.ASM      :Source code for event handler and external routines
  27.                           of the MOUSE unit.
  28.           MOUSE.OBJ      :Object code for MOUSE.ASM assembled using TASM.
  29.           MSDEMO.PAS     :Source code for the demo program.
  30.           MSDEMO.EXE     :Demonstration program compile using TP 5.5
  31.           MSDEMO.DOC     :This file.
  32.       
  33.           MSDEMO  is a simple program which exhibits some of the capabilities of
  34.      using an interrupt driven interface to the mouse. The program first sets up
  35.      by  calling 'MouseRegister'. This routine checks to see if a mouse drive is
  36.      installed  on the system.  Once that is established  it registers the mouse
  37.      event  handler with the  installed mouse driver  and initializes the global
  38.      variables that make available the mouse status to the rest of the program.
  39.           After  registering  the interrupt  handler with  the mouse  driver the
  40.      program displays the mouse cursor and then goes into a loop where it checks
  41.      to  see  if a  mouse  event has  occured. This  is  signaled by  the global
  42.      variable  'EventFlag' changing to  non-zero. Once this  happens the program
  43.      then  displays the  state of  the mouse  on the  screen. Which  buttons are
  44.      pressed  if any, the X and  Y location of the mouse  cursor, as well as its
  45.      screen  offset  address are  all display  with  each event  occurance. This
  46.      continues   until   the  right   and   left  mouse   buttons   are  pressed
  47.      simultaneously,  at which time the program  will reset the mouse driver and
  48.      exit to DOS.
  49.           Like I said simple. Hope you find this of some use.
  50.       
  51.           Bob Landry, Compuserve [73300,1717]
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.